<!DOCTYPE html>
<html lang="en" style="height:100%">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>举报</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css" />
    <link rel="stylesheet" type="text/css" href="../../css/vant.css" />
    <!-- <link rel="stylesheet" href="../../css/sqc.css"> -->
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        input{
            outline:none;
        }
        .activ {
            border: 1px solid #F95656 !important;
            background-color: #FFDDDD;
            color: #F95656;
        }
    </style>
</head>

<body style="background: #fff;">
<div id="app"  v-cloak>
    <div class="report-item" style="padding-top: 60px;background-color: #fff;">
        <div class="user-title header-title" style="border-bottom: 1px solid #f7f4f2">
            <span style="position: relative;" v-back.tapmode>
                <img style="width: 8.5px;height: 16px;" v-src="'../../image/back_heise-1.png'" />
            </span>
            <div class="home-name">
                <span class="personal-name">举报</span>
            </div>

        </div>
        <div class="report-user">
            <span>本次举报用户</span>
            <img :src="avatar"/>
            <span style="color: #333;font-weight: bold;">{{nickname}}</span>
        </div>
        <div class="message" >
            <div class="message-title" v-for="(item, index) in items"
                 :class="{activ:item.id == addSelected}"
                 v-myclick="[item.id,changeColor]"
            >{{item.type_name}}</div>
            <div class="mess" style="width: 100%;padding: 0 6px;box-sizing: border-box;">
                <textarea placeholder="其它，请输入" v-model="extra_description"></textarea>
            </div>
        </div>
        <div class="report-sub">
            <span style="font-size: 12px;color: #999;">举报须知：本人确定举报信息的真实性，不恶意提交举报，若有恶
意提交举报他人评论的行为，愿意接受官方处理。
            </span>
            <div v-myclick="report" class="regrist-button" style="width: 100%;margin-top: 12px;background-color: #F95656">提交</div>
        </div>
    </div>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/components.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript" src="../../script/vant.min.js"></script>

<script>
    var vm,
        items;
    apiready = function () {
        setBSImg();
        new Vue({
            el: '#blank'
        })
        wx = api.require('wx');
        var data = {
            member_id: getPrefs('member_id'),
        };
        var callback = function (ret) {
          items = ret.content;
          console.log(JSON.stringify(items))
          initApp();
        };
        pinet.post(APIURL+'/app/dynamic/reportType', data, callback);
        // setBSImg();
        initApp();
        api.parseTapmode();
    };

    function initApp() {
        // var isBigImg = Vue.BSImg == 'big';
        vm = new Vue({
            el: '#app',
            data: {
                lists:["垃圾运营","涉黄信息","不实信息","人身攻击","泄漏我的隐私","有害信息","内容抄袭","冒充我","违法信息","诈骗信息"],
                addSelected:items[0].id,
                items:items,
                nickname:api.pageParam.nickname,
                avatar:api.pageParam.avatar,
                extra_description:''
            },
            computed: {

            },
            methods: {
                changeColor:function(id) {
                    this.addSelected = id;
                },
                report:function(){
                  var data = {
                      member_id:getPrefs('member_id'),
                      dynamic_id: api.pageParam.id,
                      report_id:this.addSelected,
                      extra_description:this.extra_description
                  };
                  var callback = function (ret) {
                    api.toast({
                        msg: ret.message,
                        duration: 2000,
                        location: 'middle'
                    });
                    setTimeout(function (){closeWin()},"1000");
                  };
                  pinet.post(APIURL+'/app/dynamic/dynamicReport', data, callback);
                }

            },
            watch: {

            },
        })
    }


</script>

</html>
